/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.makcro.sms.services.chat.model;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author makcro
 */
@Entity
@Table(name = "bulkgroup")
@NamedQueries({
    @NamedQuery(name = "BulkGroup.findAll", query = "SELECT b FROM BulkGroup b"),
    @NamedQuery(name = "BulkGroup.findAllActive", query = "SELECT b FROM BulkGroup b where b.active = true")})
public class BulkGroup implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id", nullable = false)
    private Integer id;
    @Column(name = "GroupName", length = 256)
    private String groupName;
    @Column(name = "GroupDescription", length = 1024)
    private String groupDescription;
    @Column(name = "Active")
	private Boolean active;
    @OneToMany(mappedBy = "bulkGroup", fetch = FetchType.EAGER)
    private Set<BulkGroupItem> bulkGroupItemSet;

    public BulkGroup() {
    }

    public BulkGroup( Integer id ) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId( Integer id ) {
        this.id = id;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName( String groupName ) {
        this.groupName = groupName;
    }

    public String getGroupDescription() {
        return groupDescription;
    }

    public void setGroupDescription( String groupDescription ) {
        this.groupDescription = groupDescription;
    }

    public Set<BulkGroupItem> getBulkGroupItemSet() {
        return bulkGroupItemSet;
    }

    public void setBulkGroupItemSet( Set<BulkGroupItem> bulkGroupItemSet ) {
        this.bulkGroupItemSet = bulkGroupItemSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals( Object object ) {
        if (!(object instanceof BulkGroup)) {
            return false;
        }
        BulkGroup other = (BulkGroup) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals( other.id ))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "smschatmodel.BulkGroup[ id=" + id + " ]";
    }

	public void setActive(Boolean active) {
		this.active = active;
	}

	public Boolean getActive() {
		return active;
	}
    
}
